package com_djm_2025_05_15;

/**
 * @author dengjiangming
 * @version 1.1.0
 * @date   2025-05-15
 */

//递归求N的阶乘
public class Demo2 {
    public static int func(int n){
        if(n == 1){
            return 1;
        }

        return n*func(n - 1);
    }

    public static void main(String[] args) {
        System.out.println(func(5));
    }
}
